package uit.nfcmenu.utils;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Hashtable;

import uit.nfcmenu.models.OrderChef;


public class CommConstant {

	/*
	 * status in order process
	 */

	public static String[] Status = { "NEW", "WAITING", "COOKING", "COOKED",
			"SERVED", "DENY", "DONE" };


	public enum OrderStates {
		NEW, WAITING, COOKING, COOKED, SERVED, DENY, DONE
	};

	/*
	 * get data success in response by getting on server
	 */
	public static final String GET_DATA_SUCCESS = "Done!";
	
	public static ArrayList<String> request=new ArrayList<String>();
	
	/*
	 * timer
	 */
	public static final int TIME_PAUSE_UPDATE_DATA = 30000; // 1'
	public static final int TIME_PAUSE_UPDATE_VIEW = 10000; // 10s

	public static Hashtable<Integer, String> item;
	public static ArrayList<OrderChef> cooked;
	public static String Timeupdate = "";

	public static String parseFromdate(Date date) {
		String FORMAT_DAY = "EEE MMM dd hh:mm:ss zzz yyyy";
		DateFormat datef = new SimpleDateFormat(FORMAT_DAY);
		return datef.format(date);
	}

	public static Date parsefromString(String date) {
		String FORMAT_DAY = "EEE MMM dd hh:mm:ss zzz yyyy";
		DateFormat datef = new SimpleDateFormat(FORMAT_DAY);
		try {
			return datef.parse(date);
		} catch (Exception e) {
			return null;
		}
	}
}
